Search

Nalezeno "aspect ratio": 16

“Weak declaration”


PPK looks at aspect-ratio, a CSS property for layout that, for the most part, does exactly what you would think it does. It’s getting more interesting as it’s behind a flag in Firefox and Safari now, so we’ll have … The post “Weak declaration” appeared first...

Super Mario World Is Now Playable In Widescreen


Software engineer and SNES ROM hacker Vitor Vilela has led a team which has created and released Super Mario World Widescreen, a download that lets you play Nintendo’s Super Mario World—first released in 1990—on modern widescreen displays.Read more

Variable Aspect Ratio Card With Conic Gradients Meeting Along the Diagonal


I recently came across an interesting problem. I had to implement a grid of cards with a variable (user-set) aspect ratio that was stored in a --ratio custom property. Boxes with a certain aspect ratio are a classic problem in … The post Variable Aspect Ratio Card With Conic Gradients...

New in Chrome 88: aspect-ratio


And it was released yesterday! The big news for us in CSS Land is that the new release supports the aspect-ratio property. This comes right on the heels of Safari announcing support for it in Safari Technology Preview 118, … The post New in Chrome 88: aspect-ratio appeared first...

`aspect-ratio` is going to deprecate FitVids


Jen was just tweetin’ about how the latest Safari Technical Preview has aspect-ratio. Looks like Chrome and Firefox both have it behind a flag, so with Safari joining the party, we’ll all have it soon. I played with it … The post `aspect-ratio` is going to deprecate FitVids...

Fluid Images in a Variable Proportion Layout


Creating fluid images when they stand alone in a layout is easy enough nowadays. However, with more sophisticated interfaces we often have to place images inside responsive elements, like this card: For now, let’s say this image is not semantic content, but only decoration. That’s...

A First Look at `aspect-ratio`


Oh hey! A brand new property that affects how a box is sized! That’s a big deal. There are lots of ways already to make an aspect-ratio sized box (and I’d say this custom properties based solution is the best), but none of them are particularly intuitive and certainly not...

A Grid of Logos in Squares


Let’s build a literal grid of squares, and we’ll put the logos of some magazines centered inside each square. I imagine plenty of you have had to build a logo grid before. You can probably already picture it: an area of a site that lists the donors, sponsors, or that is showing off...

Fluid Width Video


IN A WORLD of responsive and fluid layouts on the web, ONE MEDIA TYPE stands in the way of perfect harmony: video. There are lots of ways in which video can be displayed on your site. You might be self-hosting the video and presenting it via the HTML5 <video tag. You might...

Do This to Improve Image Loading on Your Website


Jen Simmons explains how to improve image loading by simply using width and height attributes. The issue is that there’s a lot of jank when an image is first loaded because an img will naturally have a height of 0 before the image asset has been successfully downloaded by the browser. Then it needs...

Centering a div That Maintains Aspect-Ratio When There’s Body Margin


Andrew Welch had a little CSS challenge the other day to make an ordinary div: • centered vertically + horizontally• scales to fit the viewport w/ a margin around it• maintains an arbitrary aspect ratio• No JS There's a video in that tweet if it helps you visualize the challenge. I saw Paul...

Oh Hey, Padding Percentage is Based on the Parent Element’s Width


I learned something about percentage-based (%) padding today that I had totally wrong in my head! I always thought that percentage padding was based on the element itself. So if an element is 1,000 pixels wide with padding-top: 50%, that padding is 500 pixels. It's weird having top padding based...

Responsive Iframes


Say you wanted to put the CSS-Tricks website in an <iframe>. You'd do that like this: <iframe src="https://css-tricks.com"></iframe> Without any other styling, you'd get a rectangle that is 300x150 pixels in size. That's not even in the User Agent stylesheet, it's just some...

The Fight Against Layout Jank


A web page isn't locked in stone just because it has rendered visually. Media assets, like images, can come in and cause the layout to shift based on their size, which typically isn't known in fluid layouts until they do render. Or fonts can load and reflow layout. Or XHRs can bring in more content...

What if we got aspect-ratio sized images by doing almost nothing?


Say you have an image you're using in an <img> that is 800x600 pixels. Will it actually display as 800px wide on your site? It's very likely that it will not. We tend to put images into flexible container elements, and the image inside is set to width: 100%;. So perhaps that image ends...

Designing An Aspect Ratio Unit For CSS


Rachel Andrew says that the CSS Working Group designed an aspect ration unit at a recent meeting. The idea is to find an elegant solution to those times when we want the height of an element to be calculated in response to the width of the element, or vice versa. Say, for example, we have a grid...

Nahoru
Tento web používá k poskytování služeb a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tímto souhlasíte. Další informace